<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <meta charset="UTF-8">
        <title>待处理异常信息</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="__HOME_CSS__/font.css">
        <link rel="stylesheet" href="__HOME_CSS__/xadmin.css">
        <script src="__HOME_JS__/echarts.min.js"></script>
        <script src="__HOME_LIB__/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="__HOME_JS__/xadmin.js"></script>
    </head>
    
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="{:url('index/index/welcome')}">后台首页</a>
                <a href="">信息统计</a>
                <a><cite>异常信息记录</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <form class="layui-form layui-col-space5">
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input class="layui-input" placeholder="开始时间" autocomplete="off" name="start" id="start"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input class="layui-input" placeholder="截止时间" autocomplete="off" name="end" id="end"></div>
                                <div class="layui-input-inline">
                                    <select name="type">
                                        <option value="">异常类型</option>
                                        <option value="超时未还">超时未还</option>
                                        <option value="柜门未关" >柜门未关</option>
                                        <option value="报废警报">报废警报</option>
                                    </select>
                                </div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <select name="device_name">
                                        <option value="">设备名称</option>
                                        {volist name='device_name' id='vo'}
                                        <option value="{$key}">{$vo}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <select name="device_model">
                                        <option value="">设备型号</option>
                                        {volist name='device_model' id='vo'}
                                        <option value="{$key}">{$vo}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input type="text" name="username" placeholder="输入员工姓名精确查询" autocomplete="off" class="layui-input"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input type="text" name="user_serial" placeholder="输入员工编号精确查询" autocomplete="off" class="layui-input"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input type="text" name="device_serial" placeholder="输入设备编号精确查询" autocomplete="off" class="layui-input"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                        <i class="layui-icon">&#xe615;</i></button>
                                </div>
                            </form>
                        </div>
                       
                        <div class="layui-card-body ">
                            <table class="layui-table layui-form">
                                <thead>
                                    <tr>
                                        <th>
                                            <input type="checkbox" name="" lay-skin="primary">
                                        </th>
                                        <th>异常时间</th>
                                        <th>异常类型</th>
										<th>设备名称</th>
                                        <th>柜体编号</th>
                                        <th>柜门编号</th>
										<th>设备编号</th>
                                        <th>操作人员</th>
                                        <th>人员编号</th>
										<th>操作</th>
                                        </tr>
                                </thead>
                                <tbody>
                                    {volist name='row' id='vo'}
                                    <tr>
                                        <td><input type="checkbox" name="" lay-skin="primary"></td>
                                        <td>{$vo.createtime|date='Y-m-d H:i:s'}</td>
                                        <td>{$vo.type_text}</td>
										<td>{$vo.device_cate_name}-{$vo.device_name}-{$vo.device_model}</td>
                                        <td>{$vo.gear_serial}</td>
                                        <td>{$vo.door_id}</td>
										<td>{$vo.device_serial}</td>
                                        <td>{$vo.username}</td>
                                        <td>{$vo.user_serial}</td>
										<td class="td-manage">
                                            <span onclick="xadmin.open('处理记录','{:url('index/information/add_read_note?id='.$vo.record_id)}',600,400);return false" class="layui-btn layui-btn-mini">处理异常</span>
<!--                                            <a title="已读" onclick="read(this,{$vo.record_id})" href="javascript:;"><i class="layui-icon">&#xe63c;</i></a>-->
                                        </td>
                                    </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
						<div class="layui-card-header">
                            <button class="layui-btn" onclick="window.open('{:url('index/information/unusual_record_export')}')">
                                <i class="layui-icon"></i>导出数据</button></div>
                        <div class="layui-card-body ">
                            <div class="page">
                                {:$pages}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script>layui.use(['laydate', 'form'],
        function() {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });


        /*执行安全检查*/
        function read(obj, id) {
            $.ajax({
                url: "{:url('index/information/read_unusual')}",
                type: "POST",
                sync: false,
                data: {
                    id: id
                },
                success: function (ret) {
                    if (ret.code === 0) {
                        $(obj).parents("tr").remove();
                        layer.msg(ret.msg, {
                            icon: 1,
                            time: 1500
                        });
                    } else {
                        layer.msg(ret.msg, {
                            icon: 0,
                            time: 2000
                        });
                    }
                }
            });
        }

    </script>

</html>